<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>Untitled</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="language" content="en" />
    <meta name="description" content="" />
    <meta name="keywords" content="" />
</head>
<body>
    <div>
        <br/>
        <button id="btnShow">显示提示文字</button>
    </div>
    <div id="divPop" style="background-color: #f0f0f0; border: solid 1px #000000; position: absolute; display:none;  
        width: 300px; height: 100px;">
        <div style="text-algin:center;">弹出层</div>
        
    </div>
</body>
<script src="scripts/jquery-1.6.4.js"></script>
<script>
    $(document).ready(
        function()
        {
            //动画速度 
            var speed = 500;
            //绑定事件处理  
            $("#btnShow").click(
				function(event)
				{
                    //取消事件冒泡
                    var target = $(event.target);
					event.stopPropagation();
                    //设置弹出层位置
					var offset = target.offset();
					var divPopDom = $("#divPop");
					divPopDom.css(
						{
							top:offset.top + target.height()+"px",
							left:offset.left
						}
					);
                    //动画显示
					divPopDom.show(speed);
				}
			);
			
			 //单击空白区域隐藏弹出层  
            $(document).click(function(event) { $("#divPop").hide(speed) });  
            //单击弹出层则自身隐藏  
            $("#divPop").click(function(event) { $("#divPop").hide(speed) });
        }
    );

</script>
</html>